Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve test result reporting in Styx functional test suite #485

Merged
merged 1 commit into from
Oct 14, 2019

Conversation

mikkokar
Copy link
Contributor

This PR improves test result reporting, especially for failures.

The new TestErrorReporter class listens for Kotlintest lifecycle notifications and logs the results accordingly. The ProjectConfig applies this listener globally for all existing test suites without having to modify existing tests.

This makes the following information available in the Travis logs.

At the start of each spec, it logs:

08:57:12.335 [kotlintest-engine-0 @coroutine#1] INFO  StyxFT - Starting com.hotels.styx.routing.ConditionRoutingSpec

Then, at the beginning of each test:

08:57:12.344 [pool-3-thread-1 @coroutine#2] INFO  StyxFT - Running 'Routes HTTP protocol' - ConditionRoutingSpec.kt:35

And at the end of each passed test:

08:57:12.608 [pool-3-thread-1 @coroutine#5] INFO  StyxFT - Routes HTTP protocol - Success

And at the end of each failed test:

08:57:12.709 [pool-3-thread-1 @coroutine#9] INFO  StyxFT - Routes HTTPS protocol - Failure
08:57:12.709 [pool-3-thread-1 @coroutine#9] INFO  StyxFT - expected: 502 Bad Gateway but was: 200 OK
org.opentest4j.AssertionFailedError: expected: 502 Bad Gateway but was: 200 OK
	at com.hotels.styx.routing.ConditionRoutingSpec$2.invokeSuspend(ConditionRoutingSpec.kt:61)
	at com.hotels.styx.routing.ConditionRoutingSpec$2.invoke(ConditionRoutingSpec.kt)
	at io.kotlintest.runner.jvm.TestCaseExecutor$executeTest$supervisorJob$1$invokeSuspend$$inlined$map$lambda$1.invokeSuspend(TestCaseExecutor.kt:121)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:32)
	at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:233)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:748)

Finally, at the end of each spec:

08:57:12.710 [kotlintest-engine-0 @coroutine#1] INFO  StyxFT - Finished com.hotels.styx.routing.ConditionRoutingSpec

@mikkokar mikkokar merged commit a63928a into ExpediaGroup:master Oct 14, 2019
@mikkokar mikkokar deleted the styxft-project-config branch October 14, 2019 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants